package com.bungarus.group.cachestore;

import java.util.LinkedList;
import java.util.List;

public interface CacheTransformer<T> {
    int CACHE_ACTION_HSET = 0;
    int CACHE_ACTION_SORTED_SET = 1;

    default int getCachedAction() {
        return CACHE_ACTION_HSET;
    }

    String getCacheTableName();

    StoreRow transform(T source);

    default List<StoreRow> transform2List(T source) {
        return new LinkedList<>();
    }

    T reverse(StoreRow row);
}
